<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>zepto_offset的区别</title>
<style type="text/css">
  *{
    margin: 0;
    padding: 0;
  }
  #box{
    width: 200px;
    height: 200px;
    position: relative;
    left: 50px;
    top: 50px;
    text-align: center;
    line-height: 200px;
    background: #f00;
            padding:10px;
            border:2px solid yellow;
  }
</style>
</head>
<body>
  <!--
    * offset()
    1、获得当前元素相对于视口的位置。
    2、返回一个对象含有： top, left, width和height(获取到的width，height都是包含padding和border的值)
  -->
  <div id="box">atguigu.com</div>
<script src="../../../js/zepto.js" type="text/javascript" charset="utf-8"></script>
<script type='text/javascript'>
  $(function () {
    console.log($('#box').offset())
  })
</script>
</body>
</html>
